#include <bits/stdc++.h>

using namespace std;

struct TreeNode {
    int val;
    struct TreeNode *left;
    struct TreeNode *right;
    TreeNode(int x) :
            val(x), left(NULL), right(NULL) {
    }
};
class Solution {
public:
    bool isSymmetrical(TreeNode* pRoot)
    {
        return helper(pRoot,pRoot);
    }
    bool helper(TreeNode* pRoot1,TreeNode* pRoot2){
        if(pRoot1==nullptr && pRoot2==nullptr){
            return true;
        }else if(pRoot1==nullptr || pRoot2==nullptr){
            return false;
        }else if(pRoot1->val!=pRoot2->val){
            return false;
        }
        return helper(pRoot1->left,pRoot2->right)&&helper(pRoot1->right,pRoot2->left);
    }
};


int main(){




    return 0;
}